<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Eyao订货管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<div style="margin-top: 20px;">
</div>
<form class="layui-form" id="admin">

  <div class="layui-form-item">
    <label class="layui-form-label">供应商名称</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_name" lay-verify="store_name" autocomplete="off" placeholder="请输入供应商名称" class="layui-input" type="text" {notempty name="$data.store_name"}value="{$data.store_name}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">统一社会信用代码</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_CUFCC" lay-verify="store_CUFCC" autocomplete="off" placeholder="请输入统一社会信用代码" class="layui-input" type="text" {notempty name="$data.store_CUFCC"}value="{$data.store_CUFCC}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">组织机构代码</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_organization_code" lay-verify="store_organization_code" autocomplete="off" placeholder="请输入组织机构代码" class="layui-input" type="text" {notempty name="$data.store_organization_code"}value="{$data.store_organization_code}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">注册号</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_registration_number" lay-verify="store_registration_number" autocomplete="off" placeholder="请输入注册号" class="layui-input" type="text" {notempty name="$data.store_registration_number"}value="{$data.store_registration_number}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">经营状态</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_operating_state" lay-verify="store_operating_state" autocomplete="off" placeholder="请输入经营状态" class="layui-input" type="text" {notempty name="$data.store_operating_state"}value="{$data.store_operating_state}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">所属行业</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_industry" lay-verify="store_industry" autocomplete="off" placeholder="请输入所属行业" class="layui-input" type="text" {notempty name="$data.store_industry"}value="{$data.store_industry}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">成立日期</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_establishment_time" lay-verify="store_establishment_time" autocomplete="off" placeholder="请输入成立日期" class="layui-input" type="text" id="store_establishment_time" {notempty name="$data.store_establishment_time"}value="{$data.store_establishment_time}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">公司类型</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_business_type" lay-verify="store_business_type" autocomplete="off" placeholder="请输入公司类型" class="layui-input" type="text" {notempty name="$data.store_business_type"}value="{$data.store_business_type}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">营业期限</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_operation_period" lay-verify="store_operation_period" autocomplete="off" placeholder="请输入营业期限" class="layui-input" type="text" {notempty name="$data.store_operation_period"}value="{$data.store_operation_period}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">法定代表人</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_legal_representative" lay-verify="store_legal_representative" autocomplete="off" placeholder="请输入法定代表人" class="layui-input" type="text" {notempty name="$data.store_legal_representative"}value="{$data.store_legal_representative}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">发照日期</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_isuse_date" lay-verify="store_isuse_date" autocomplete="off" placeholder="请输入发照日期" class="layui-input" type="text" id="store_isuse_date" {notempty name="$data.store_isuse_date"}value="{$data.store_isuse_date}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">注册资本</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_registered_capital" lay-verify="store_registered_capital" autocomplete="off" placeholder="请输入注册资本" class="layui-input" type="text" {notempty name="$data.store_registered_capital"}value="{$data.store_registered_capital}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">登记机关</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_registration_authority" lay-verify="store_registration_authority" autocomplete="off" placeholder="请输入登记机关" class="layui-input" type="text" {notempty name="$data.store_registration_authority"}value="{$data.store_registration_authority}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">企业地址</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_business_address" lay-verify="store_business_address" autocomplete="off" placeholder="请输入供应商名称" class="layui-input" type="text" {notempty name="$data.store_business_address"}value="{$data.store_business_address}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">企业官网</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_siteurl" lay-verify="store_siteurl" autocomplete="off" placeholder="请输入企业官网" class="layui-input" type="text" {notempty name="$data.store_siteurl"}value="{$data.store_siteurl}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">企业联系电话</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_contact_number" lay-verify="store_contact_number" autocomplete="off" placeholder="请输入企业联系电话" class="layui-input" type="text" {notempty name="$data.store_contact_number"}value="{$data.store_contact_number}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">企业邮箱</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_contact_email" lay-verify="store_contact_email" autocomplete="off" placeholder="请输入企业邮箱" class="layui-input" type="text" {notempty name="$data.store_contact_email"}value="{$data.store_contact_email}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">收款人(银行开户名称)</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_account_name" lay-verify="store_account_name" autocomplete="off" placeholder="请输入收款人(银行开户名称)" class="layui-input" type="text" {notempty name="$data.store_account_name"}value="{$data.store_account_name}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">收款账号</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_account_number" lay-verify="store_account_number" autocomplete="off" placeholder="请输入收款账号" class="layui-input" type="text" {notempty name="$data.store_account_number"}value="{$data.store_account_number}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">收款银行</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_account_cash_bank" lay-verify="store_account_cash_bank" autocomplete="off" placeholder="请输入收款银行" class="layui-input" type="text" {notempty name="$data.store_account_cash_bank"}value="{$data.store_account_cash_bank}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">收款支行名称</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_account_cash_bank_branch" lay-verify="store_account_cash_bank_branch" autocomplete="off" placeholder="请输入收款支行名称" class="layui-input" type="text" {notempty name="$data.store_account_cash_bank_branch"}value="{$data.store_account_cash_bank_branch}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">申请时间</label>
    <div class="layui-input-block" style="max-width:600px;">
      <input name="store_create_time" lay-verify="store_create_time" autocomplete="off" placeholder="请输入申请时间" class="layui-input" type="text" id="store_create_time" {notempty name="$data.store_create_time"}value="{$data.store_create_time}"{/notempty}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">经营范围</label>
    <div class="layui-input-block" style="max-width:600px;">
      <textarea placeholder="请输入经营范围" class="layui-textarea" name="store_scope_business">{notempty name="$data.store_scope_business"}{$data.store_scope_business}{/notempty}</textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">公司简介</label>
    <div class="layui-input-block" style="max-width:600px;">
      <textarea placeholder="请输入公司简介" class="layui-textarea" name="store_intro">{notempty name="$data.store_intro"}{$data.store_intro}{/notempty}</textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">备注</label>
    <div class="layui-input-block" style="max-width:600px;">
      <textarea placeholder="请输入备注" class="layui-textarea" name="remark">{notempty name="$data.remark"}{$data.remark}{/notempty}</textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">认证状态</label>
    <div class="layui-input-block">
      <input type="radio" name="store_auth_status" value="1" title="认证中" checked>
      <input type="radio" name="store_auth_status" value="2" title="认证通过">
      <input type="radio" name="store_auth_status" value="3" title="认证失败">
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">启用状态</label>
    <div class="layui-input-block">
      <input type="radio" name="status" value="1" title="启用" checked>
      &nbsp;&nbsp;
      <input type="radio" name="status" value="2" title="禁用">
    </div>
  </div>

  <div class="layui-upload" id="upload-thumb">
    <label class="layui-form-label">营业执照图片</label>
    <button type="button" class="layui-btn" id="store_licence_picture"><i class="layui-icon">&#xe67c;</i>上传图片</button>
    <div class="layui-upload-list">
      <label class="layui-form-label"></label>
      <img class="layui-upload-img" id="demo1" width="150" height="150" {notempty name="$data.store_licence_picture"}src="{$data.store_licence_picture|geturl}"{/notempty}>{notempty name="$data.store_licence_picture"}<input type="hidden" name="store_licence_picture" value="{$data.store_licence_picture}">{/notempty}
      <p id="demoText"></p>
    </div>
  </div>

  <input type="hidden" name="id" value="{$data.id}">

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>

</form>


<script src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/jquery/jquery.min.js"></script>

<script>
    layui.use('upload', function(){
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#store_licence_picture' //绑定元素
            ,url: "{:url('common/upload')}" //上传接口
            ,data:{use:'store_licence_picture'}
            ,done: function(res){
                //上传完毕回调
                if(res.code == 2) {
                    $('#demo1').attr('src',res.src);
                    $('#upload-thumb').append('<input type="hidden" name="store_licence_picture" value="'+ res.id +'">');
                } else {
                    layer.msg(res.msg);
                }
            }
            ,error: function(){
                //请求异常回调
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function(){
                    uploadInst.upload();
                });
            }
        });
    });
</script>
<script>

    layui.use(['layer', 'form'], function() {
        var layer = layui.layer,
            $ = layui.jquery,
            form = layui.form;
        $(window).on('load', function() {
            form.on('submit(admin)', function(data) {
                $.ajax({
                    url:"{:url('admin/store/edit')}",
                    data:$('#admin').serialize(),
                    type:'post',
                    async: false,
                    success:function(res) {
                        if(res.code == 1) {
                            layer.alert(res.msg, function(index){
                                location.href = res.url;
                            })
                        } else {
                            layer.msg(res.msg);
                        }
                    }
                })
                return false;
            });
        });
    });

    // 日期控件
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#store_establishment_time'  //注册时间
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#store_isuse_date'  //发照日期
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#store_create_time'  //申请时间
        });

    });

</script>

</body>
</html>